<?php

//CORREGIDA

namespace Medicina\KernelBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Medicina\KernelBundle\Entity\PersonaOcupaCargo
 *
 * @ORM\Entity
 */
class PersonaOcupaCargo {

    /**
     * @ORM\Column(name="id", type="integer", nullable=false)
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="IDENTITY")
     */
    private $id;

    /**
     * @ORM\Column(name="fechaInicio", type="datetime", nullable=false)
     */
    private $fechaInicio;

    /**
     * @ORM\Column(name="fechaFin", type="datetime", nullable=false)
     */
    private $fechaFin;

    /**
     * @ORM\Column(name="renueva", type="boolean", nullable=true)
     */
    private $renueva;

    /**
     *
     * @ORM\Column(name="concurso_id", type="integer", length=10 ,nullable=true)
     */
    private $concurso_id;

    /**
     * @ORM\ManyToOne(targetEntity="Cargo", inversedBy="personas" , cascade={"persist"})
     * @ORM\JoinColumn(name="cargo_id", referencedColumnName="id")
     * 
     */
    private $cargo;

    /**
     * @ORM\ManyToOne(targetEntity="Persona", inversedBy="cargos", cascade={"persist"})
     * @ORM\JoinColumn(name="persona_id", referencedColumnName="id")
     */
    private $persona;

    public function getId() {
        return $this->id;
    }

    public function setFechaInicio($fechaInicio) {
        $this->fechaInicio = $fechaInicio;
    }

    public function getFechaInicio() {
        return $this->fechaInicio;
    }

    public function setFechaFin($fechaFin) {
        $this->fechaFin = $fechaFin;
    }

    public function getFechaFin() {
        return $this->fechaFin;
    }

    public function setRenueva($renueva) {
        $this->renueva = $renueva;
    }

    public function getRenueva() {
        return $this->renueva;
    }

    public function setCargo(\Medicina\KernelBundle\Entity\Cargo $cargo) {
        $this->cargo = $cargo;
    }

    public function getCargo() {
        return $this->cargo;
    }

    public function setPersona(\Medicina\KernelBundle\Entity\Persona $persona) {
        $this->persona = $persona;
    }

    public function getPersona() {
        return $this->persona;
    }

    public function getInfoShow() {
        return $this->getPersona()->getInfoShow();
    }

    public function getNombre() {
        return $this->getPersona()->getNombre();
    }

    public function __toString() {
        return $this->getPersona()->__toString();
    }

    /**
     * Set concurso
     *
     * @param Medicina\KernelBundle\Entity\Concurso $concurso
     */
    public function setConcurso(\Medicina\KernelBundle\Entity\Concurso $concurso) {
        $this->concurso = $concurso;
    }

    /**
     * Get concurso
     *
     * @return Medicina\KernelBundle\Entity\Concurso 
     */
    public function getConcurso() {
        return $this->concurso;
    }


    /**
     * Set concurso_id
     *
     * @param integer $concursoId
     */
    public function setConcursoId($concursoId)
    {
        $this->concurso_id = $concursoId;
    }

    /**
     * Get concurso_id
     *
     * @return integer 
     */
    public function getConcursoId()
    {
        return $this->concurso_id;
    }
}